<!DOCTYPE html>
<html lang="en">
<head>
    <title>用款审核APP</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <style>
        [v-cloak] {
            display: none;
        }

        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            font-size: 12px;
        }

        body {
            margin: 1px;
            background: white;
        }
        .progressobj {
            display: flex;
            justify-content: space-between;
            height: 20px;
        }

        .jiaobiao, .jiaobiaoNew {
            position: relative;
        }

        .jiaobiao i {
            display: block;
            width: 0;
            height: 0;
            border-width: 0px 0 12px 12px;
            border-style: solid;
            border-color: transparent transparent transparent #2a8cec;
            position: absolute;
            top: 0px;
            left: 0px;
        }

        .progressobj .delfile {
            float: right;
            margin-right: 10px;
        }

        table {
            border-spacing: 0;
            border-collapse: collapse;
            display: table;
        }

        table.text-center, table.text-center td, table.text-center th {
            text-align: center;
            font-size: 12px;
        }

        .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
            border: 1px solid #cbcbcd;
            font-weight: normal;
            height: 24px;
        }

        table th {
            background: #f8f8f8;
        }

        .table-bordered {
            border: 1px solid #cbcbcd;
        }

        .table {
            width: 100%;
            max-width: 100%;
        }

        .hidden {
            display: none;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            /*max-height: 24px;*/
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            text-align: left;
        }

        .mScrollBox {
            float: left;
            position: relative;
            overflow: hidden;
        }

        .infoReport {
            text-align: center;
            margin: 0;
            margin-bottom: 10px;
        }

        .moduleName {
            height: 20px;
            line-height: 20px;
            background: #f8f8f8;
            font-weight: bold;
            font-size: 14px;
        }
        .toggleDiv div {
            width: 50%;
            float: left;
            text-align: center;
        }

        .toggleDiv div.active {
            border-bottom: 2px solid #2289ee;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }
        .text-center{
            text-align: center;
        }
        .td-title{
            background-color: #F5F5F5;
        }

        element.style {
            width: 16%;
        }
        .table-detail {
            width: 100%;
            border-left: 1px solid #e8e8e9;
            border-top: 1px solid #e8e8e9;
            border-spacing: 0;
            /*table-layout: fixed;*/
        }
        .table-detail .td-title {
            background-color: #f5f5f5;
        }
        .table-detail td {
            height: 29px;
            /*line-height: 29px;*/
            text-align: center;
            position: relative;
            overflow: hidden;
            word-wrap: break-word;
        }
        .table-detail td input{
            display: inline-block;
            outline: none;
            border:0;
            /*background: #F8F8F8;*/
            padding:0;
            margin:0;
            /*width:93px;*/
            text-align: center;
            color: #2a8cec;
        }
       /* .table-detail td span{
            color: #2a8cec;
        }*/
        .table-detail td textarea,.table-detail td select{
            width:100%;
            height:100%;
            line-height: 100%;
            padding-top: 20px;
            padding-left: 6px;
            outline: none;
            resize: none;
            border: none;
            color: #2a8cec;
        }
        .table-detail td select{
            padding-top: 0px;
            padding-left:0px;
            width:auto;
            border:none;
            color: #2a8cec;
        }
        .btn {
            border-radius: 3px;
            -webkit-box-shadow: none;
            box-shadow: none;
            border: 1px solid transparent;
        }
        .btn-primary {
            background-color: #228bee;
            border-color: #127ee5;
            color: #fff;
        }
        .btn-group-sm > .btn, .btn-sm {
            padding: 5px 10px;
            font-size: 12px;
            line-height: 1.5;
            border-radius: 3px;

        }
        .model-picker-input {
            opacity: 0 !important;
            top: -9999px;
            left: -9999px;
            position: absolute;
        }

        .model-picker-span {
            position: relative;
            display: block;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            border-bottom: 1px solid #ccc;
            background-color: #fff;
            color: #ccc;
            cursor: pointer;
        }

        .model-picker-span>.placeholder {
            color: #aaa;
        }

        .model-picker-span>.arrow {
            position: absolute;
            top: 50%;
            right: 8px;
            width: 10px;
            margin-top: -3px;
            height: 5px;
            background: url(../images/drop-arrow.png) -10px -25px no-repeat;
        }

        .model-picker-span.focus,
        .model-picker-span.open {
            border-bottom-color: #46A4FF;
        }

        .model-picker-span.open>.arrow {
            background-position: -10px -10px;
        }

        .model-picker-span>.title>span {
            color: #333;
            padding: 5px;
            border-radius: 3px;
        }

        .model-picker-span>.title>span:hover {
            background-color: #f1f8ff;
        }

        .model-picker-dropdown {
            position: absolute;
            width: 315px;
            left: -9999px;
            top: -9999px;
            outline: 0;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            z-index: 999999;
            display: none;
            min-width: 330px;
            margin-bottom: 20px;
            margin-top: 10px;
        }

        .model-select-wrap {
            width: 75%;
            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
        }

        .model-select-tab {
            border-bottom: 1px solid #ccc;
            background: #f5f5f5;
            font-size: 13px;
        }

        .model-select-tab>a {
            display: inline-block;
            padding: 4px 20px;
            border-left: 1px solid #ccc;
            border-bottom: 1px solid transparent;
            color: #4D4D4D;
            text-align: center;
            outline: 0;
            text-decoration: none;
            cursor: pointer;
            font-size: 14px;
            margin-bottom: -1px;
        }

        .model-select-tab>a.active {
            background: #fff;
            border-bottom: 1px solid #fff;
            color: #46A4FF;
        }

        .model-select-tab>a:first-child {
            border-left: none;
        }

        .model-select-tab>a:last-child.active {
            border-right: 1px solid #ccc;
        }

        .model-select-content {
            width: 100%;
            min-height: 10px;
            background-color: #fff;
            /*padding: 5px 5px;*/
        }

        .model-select {
            font-size: 13px;
        }

        .model-select dl {
            line-height: 2;
            clear: both;
            padding: 3px 0;
            margin: 0;
        }

        .model-select dt {
            position: absolute;
            width: 2.5em;
            font-weight: 500;
            text-align: right;
            line-height: 2;
        }

        .model-select dd {
            margin-left: 0;
            line-height: 2;
        }

        .model-select.province dd {
            margin-left: 3em;
        }

        .model-select a {
            display: inline-block;
            padding: 0 10px;
            outline: 0;
            text-decoration: none;
            white-space: nowrap;
            margin-right: 2px;
            text-decoration: none;
            color: #333;
            cursor: pointer;
        }

        .model-select a:hover,
        .model-select a:focus {
            background-color: #f1f8ff;
            border-radius: 2px;
            color: #46A4FF;
        }

        .model-select a.active {
            background-color: #46A4FF;
            color: #fff;
            border-radius: 2px;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: #333;
        }
        td.td-value,span{
            /*padding-left: 6px;*/
        }
        td.td-value{
            background-color: white;
        }
        .user {
            height: 30px;
            line-height: 30px;
            max-height: 30px;
            float: left;
            text-align: left;
            /*min-width: 32px;*/
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }

        .user:hover {
            background-color: #cfd4d1;
        }
        td .lookFj {
            /*width: 100%;*/
            color: #2a8cec;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            position: relative;
            cursor: pointer;
            background: none;
            padding-left: 6px;
            text-align: left;
            height: 100%;
            width: 200px;
        }
        .fujian {
            /*display: inline-block;*/
            cursor: pointer;
            padding-left: 19px;
            background: url(/dist/img/fujian.png) no-repeat 6px center;
            color: #2a8cec;
        }
        .lineTwo span {
            line-height: 16px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            text-align: left;
        }
        .lefts {
            text-align: center;
            color: #2a8cec;
            background-image: url(/dist/img/tabApp.png);
            margin-left: 8px;
            margin-right: 8px;
            background-size: 100% 100%;
            padding: 10px 15px 15px;
        }

        .rights {
            text-align: center;
            color: #fff;
            font-size: 14px;
            /*border-bottom: 2px solid #f8f8f8;*/
            margin-left: 4px;
            margin-right: 4px;
            margin-top: 3px;
            padding-bottom: 5px;
        }

        .slide-box {
            display: -webkit-box;
            overflow-x: scroll;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            height: 45px;
            line-height: 45px;
            background: #2a8cec;
            float: left;
            padding-left: 5px;
        }
        .shenhebtn{
            background-color: #228bee;
            width: 33.3%;
            float:left;
            color:#fff;
            font-size: 14px;
            position: relative;
        }
        .ui_state_focus .ui_title{
            background: #2a8cec;
            color: #fff;
        }
        .ui_close{
            color: #fff !important;
        }
    </style>
</head>
<body>
<section class="content" id="app" v-cloak style="padding: 0px;">
    <div class="div-td-content-more"><i></i></div>
    <!--<div style="overflow: hidden;background: #2a8cec;position: fixed;top: 0;left: 0;width: 100%;z-index: 11111;">-->
        <!--<div class="slide-box">-->
            <!--<div  class="rights">-->
                <!--&lt;!&ndash;v-for="(item,i) in companyList"&ndash;&gt;-->
                <!--<span >-->
                    <!--&lt;!&ndash;:class="selectCompany==i? 'lefts':'rights'" style="height: 30px"&ndash;&gt;-->
                      <!--&lt;!&ndash;@click="selectCompany=i;get_departList(item)"&ndash;&gt;-->
                    <!--付款审核-->
                <!--</span>-->
            <!--</div>-->
        <!--</div>-->
    <!--</div>-->
    <table class="table-detail" style="width: 100%;table-layout: fixed;" id="scrollDiv">
        <tbody>
        <div class="init-loading list-group-item text-center" style="display: none;">下拉可以刷新</div>
        <template  v-for="(item,i) in list">
            <tr style="border: 1px solid #d8d8d8;border-bottom: none;position:relative;">
                <div style="width: 10%;position:absolute;right: 0;" v-if="pageType=='pay'">
                    <input type="checkbox" enabled="isEnable(item)" v-model="item.checked"
                            @click="checked(item)" :checked="isArray(item.id)" style="color: #2a8cec;"
                           v-if="item.currentAuditorId == searchParams.userId && item.auditFlag=='3'"/>
                    <input type="checkbox" enabled="isEnable(item)" v-model="item.checked"
                           @click="checked(item)" :checked="isArray(item.id)"
                           v-else disabled/>
                </div>
                <td style="width: 20%;color: #2a8cec;text-align: left;padding-left: 4px;" @click="goDetail('look',item)">{{item.type}}</td>
                <td colspan="2" @click="goDetail('look',item)">¥{{fmoney(item.money)}}</td>
                <td style="width: 20%;" @click="goDetail('look',item)">
                    <span v-if="item.auditFlag=='6'||item.auditFlag==6">
                        {{formatDate(item.payDate)}}
                    </span>
                    <span v-else>{{item.createTime?formatDate(item.createTime):formatDate(item.updateTime)}}</span>
                </td>
                <td style="width: 15%;color: #666;">{{item.createUserName}}</td>
            </tr>
            <tr style="border: 1px solid #d8d8d8;border-top: none;">
                <td class="lineOne" colspan="3">
                    <span style="color: #666;padding-left: 4px;">{{item.description}}</span>
                </td>
                <td colspan="2" style="text-align: right;padding-right: 10px;" v-html="convertAuditFlagToName(item)"></td>
            </tr>
        </template>
        </tbody>
    </table>
    <!--滚动加载需要当传回的数据小余30条时显示-->
    <div class="noMore" v-if="isMore" style="text-align: center;">没有更多了~</div>
    <div class="south no-print" style="height:50px;line-height:50px;text-align:center;bottom:0;position: fixed;width: 100%;"  v-if="pageType=='pay'">
        <div  class="shenhebtn"  @click="batchAudit('4')">
            通过
            <span style="position: absolute;width:1px;height:14px;font-size:20px;right:3px;top:-3px;">|</span>
        </div>
        <div class="shenhebtn" style="width: 33.4%;" @click="batchAudit('5')">驳回
            <span style="position: absolute;width:1px;height:14px;font-size:20px;right:4px;top:-2px;">|</span>
        </div>
        <div class="shenhebtn" @click="isCheckedAllBtn">

            <span style="font-size: 14px;" v-if="isCheckedAll">取消全选</span>
            <span style="font-size: 14px;" v-else>全选</span>

        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<script src="/dist/plugins/scroll/jquery-2.1.4.min.js"></script>
<script src="/dist/plugins/jQuery/jquery.cookie.min.js"></script>
<script src="/dist/plugins/scroll/swiper.jquery.min.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/changeMoneyToChinese.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        page: {
            urlParams: null,
            queryParams: {
                requestPage: 1,
                pageSize: 15
            },
            dataUrl: '',
            createQueryParams: function () {
            },
            getByPage: function (type) {
                $.ajax({
                    url: $.wyui.page.dataUrl,
                    data: JSON.stringify($.wyui.page.queryParams),
                    beforeSend: function () {

                    },
                    complete: function () {
                    },
                    success: function (r) {
                        $.wyui.page.queryParams.requestPage++;

                        if (r.data.sendData.pager && r.data.sendData.pager.pageCount == 0) {
                            r.data.sendData.pager.pageCount = 1;
                        }
                        if (type == "scroll") {
                            $.wyui.page.getByPage_scroll_callback(r.data.sendData.records);
                        } else {
                            if ($.wyui.page.getByPage_callback_new) {
                                $.wyui.page.getByPage_callback_new(r.data.sendData.records);
                            }
                        }

                    }
                });
            }
        },
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
   function refresh() {
       $.wyui.page.queryParams.requestPage = 1;
       $.wyui.page.getByPage();
   }
    var app = new Vue({
        el:'#app',
        data:{
            isMore: false,
            companyList: [],
            selectCompany: 0,
            isCheckedAll:false,
            list: [],
            selectIds: [],
            waitPayList:[],
            searchParams: {
                selectCom: "",
                userId: getUrlParamObj().userId,
                type: '',
                auditFlag: '',
                createUserName: '',
                money: '',
                key: ''
            },
            pageType: getUrlParamObj().pageType,//apply:用款申请，pay:付款审核
            money:{
                main:{
                    id:'',
                    type:'',
                    createUserName:'',
                    orgName:'',
                    createTime:'',
                    description:'',
                    money:'',
                    auditFlag:'',
                },
            },
        },
        methods:{
            isCheckedAllBtn: function () {
                if (this.isCheckedAll) {
//                    取消全选
                    for (var i = 0; i < this.waitPayList.length; i++) {
                        var item = this.waitPayList[i];
                        item.checked = false;
                    }
                    this.selectIds = [];
                    this.isCheckedAll=!this.isCheckedAll;
                } else {
//                    全选
                    this.selectIds = [];
                    for (var i = 0; i < this.waitPayList.length; i++) {
                        var item = this.waitPayList[i];
                        item.checked = true;
                        this.selectIds.push(item.id);
                    }
                    this.isCheckedAll=!this.isCheckedAll;

                }
            },
            checked: function (item) {
                var that = this;
                if ($.inArray(item.id, that.selectIds) > -1) {
                    // 如果已经包含了该id, 则去除(单选按钮由选中变为非选中状态)
                    console.log(that.selectIds.length)
                    for (var i = 0; i < that.selectIds.length; i++) {
                        if (that.selectIds[i] == item.id) {
                            that.selectIds.splice(i, 1);
                            console.log(that.selectIds)
                        }
                    }
                } else {
                    // 选中该checkbox
                    that.selectIds.push(item.id);
                }
                if(that.selectIds.length==that.waitPayList.length){
                    that.isCheckedAll=true;
                }else{
                    that.isCheckedAll=false;
                }
            },
            isArray: function (id) {
                var that = this;
                if ($.inArray(id, that.selectIds) > -1) {
                    // 如果已经包含了该id, 则去除(单选按钮由选中变为非选中状态)
                    return true;
                } else {
                    // 选中该checkbox
                    return false;
                }
            },
            isEnable: function (item) {
                return true;
            },
            convertToChinese: function (item) {
                return changeMoneyToChinese(item);
            },
            fmoney: function (s, n) {
                n = n > 0 && n <= 20 ? n : 2;
                s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
                var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1],
                    t = "";
                for (i = 0; i < l.length; i++) {
                    t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
                }
                return t.split("").reverse().join("") + "." + r;
            },
            formatDate:function(now){
                return new Date(now).Format(TimeFormat.middle)
            },
            showDatePicker: function (e, item) {
                var that = this;
                WdatePicker({
                    onpicked: function (dp) {
                        //that.business.main.dealTime = dp.cal.getNewDateStr();
                        return true;
                    }
                });
                $(e.target).blur();
            },
            deleteFile: function (i) {
                this.money.attaches.splice(i, 1);
            },
            download: function (attachId, fileName) {
                downloadFile(attachId,fileName)
                return false;
            },
            allPrice: function () {
                var that = this;
                var num = 0;
                console.log(that.money.payees)
                for (var i = 0; i < that.money.payees.length; i++) {
                    num += parseFloat(that.money.payees[i].payeeMoney);
                }
                if (!num) {
                    num = 0
                }
                that.price = num.toFixed(2);
                that.priceChinese = changeMoneyToChinese(num.toFixed(2));
            },
            batchAudit: function (auditFlag) {
                var that = this;
                console.log(that.selectIds);
                if (that.selectIds.length == 0) {
                    alert('请选择要通过的付款申请');
                    return;
                }
                var advise = '';
                if (auditFlag == '5') {
                    this.copierReturn(2,'5')
                    return;
                }
                var newList = [];
                for (var i = 0; i < that.waitPayList.length; i++) {
                    var data = that.waitPayList[i];
                    console.log(data)
                    if (parseInt(data.auditFlag) == 3 && data.currentAuditorId == that.searchParams.userId && $.inArray(data.id, that.selectIds) > -1) {
                        newList.push(data.id)
                    }
                }
                console.log(newList)
                if (!confirm("确定通过吗？")) {
                    return;
                }
                $.wyui.postMethod("/apply/batchAudit.json",
                    {userId: that.searchParams.userId, selectIds: newList.join("','"),advise: advise},
                    function (data) {
                        alert('审核成功');
                        refresh();
                        that.selectIds = '';
                        that.isCheckedAll = false;
                    })
            },
            copierReturn: function (type,auditFlag) {
                //type : 0-抄送人驳回  1-审核人驳回 2-付款人驳回
                var that = this;
                var newList = [];
                for (var i = 0; i < that.list.length; i++) {
                    var data = that.list[i];
                    console.log(data)
                    if (parseInt(data.auditFlag) == 3 && data.currentAuditorId == that.searchParams.userId && $.inArray(data.id, that.selectIds) > -1) {
                        newList.push(data.id)
                    }
                }
                console.log(newList)
                $.dialog({
                    content: 'url:returnReasonApp.html?selectIds=' + newList.join("','") + "&t=" + new Date() + "&type=2" + "&auditFlag=" + auditFlag+"&userId="+that.searchParams.userId,
                    title: '请输入驳回原因',
                    width: 300,
                    height: 250,
                    max: false,
                    min: false,
                    lock: true
                });
            },
//            copierReturn: function (type) {
//                //alert(getUrlParamObj().receiverId)
//                //type : 0-抄送人驳回  1-审核人驳回
//                $.dialog({
//                    content: 'url:copierReturnReasonApp.html?id=' + getUrlParamObj().id + "&currentAuditorId=" + getUrlParamObj().currentAuditorId + "&receiverId=" + getUrlParamObj().receiverId,
//                    title: '驳回',
//                    width: 300,
//                    height: 250,
//                    max: false,
//                    min: false,
//                    lock: true
//                });
//            },
            convertAuditFlagToName: function (item) {
                //auditFlag:-1,0,1,2,3,4,5,6
                switch (item.auditFlag) {
                    case "-1":
                        return "<span style='color:red;position:absolute;right: 7px;'>未提交</span>";
                        break;
                    case "0":
                        if (item.currentAuditorId == this.searchParams.userId) {
                            return "<span style='color:red;position:absolute;right: 7px;bottom: 2px;'>待-" + item.currentAuditorName + "-审核</span>";
                        } else {
                            return "<span style='position:absolute;right: 7px;bottom: 2px;'>待-" + item.currentAuditorName + "-审核</span>";
                        }
                        break;
                    case "1":
                        return "<span style='position:absolute;right: 7px;bottom: 2px;'>待申请付款</span>";
                        break;
                    case "2":
                        return "<span style='position:absolute;right: 7px;bottom: 2px;'>已驳回</span>";
                        break;
                    case "3":
                        if (item.currentAuditorId == this.searchParams.userId) {
                            return "<span style='color:red;position:absolute;right: 7px;bottom: 2px;'>待-" + item.currentAuditorName + "-审核</span>";
//                            return "付款审核中";
                        } else {
                            return "<span style='position:absolute;right: 7px;bottom: 2px;'>待-" + item.currentAuditorName + "-审核</span>";
                        }
                        break;
                    case "4":
//                        var str='待付款';
//                        if(server.fwq){
//                            if(server.fwq=="wyp"){
//                                str= "待申请付款";
//                            }
//                        }
                        return "<span style='position:absolute;right: 7px;bottom: 2px;'>待付款</span>";
                        break;
                    case "5":
//                        return "已驳回";
                        return "<span style='position:absolute;right: 7px;bottom: 2px;'>付款驳回</span>";
                        break;
                    case "6":
                        return "<span style='position:absolute;right: 7px;bottom: 2px;'>已付款</span>";
                        break;
                    default :
                        break;
                }
            },
//            页面跳转
            goDetail: function (type, item) {
                var param = {
                    url: "/page/apply/money/detailApp.html?id=" + item.id + "&pageType="+getUrlParamObj().pageType+"&userId=" + getUrlParamObj().userId, //路径
                }
                JSBridge.call(ROUTER, 'navigateTo', param)
            },
        },
        mounted: function () {
            var that = this;
            $.wyui.postMethod(urlConfig.system.message.setMessageReadFlag,
                {receiverUserId: getUrlParamObj().receiverId,openUrl:'/page/apply/money/detail.html?id=' + getUrlParamObj().id, flag: '1'},
                function (r) {
            });
        }
    });
       var param = {
           cancelable: false
       }
       JSBridge.call(UI, 'showLoading', param)
       $.wyui.page.dataUrl = server.ip + urlConfig.apply.money.getByPage;
       $.extend($.wyui.page.queryParams, app.searchParams);
       $.wyui.page.queryParams.pageType = app.pageType;
       console.log($.wyui.page.queryParams.pageType)
       $.wyui.page.getByPage_callback = function (records) {
           app.list = records;
           document.getElementById("scrollDiv").scrollTop = 0;
       };
       $.wyui.page.getByPage();
       $.wyui.page.getByPage_callback_new = function (list) {
           app.list = list;
           app.waitPayList = [];
           for(var i=0;i<app.list.length;i++){
               if(app.list[i].auditFlag=='3'&&app.list[i].currentAuditorId==app.searchParams.userId){
                   app.waitPayList.push(app.list[i])
               }
           }
       };
</script>
<script>
    //非滚动加载回调函数
    $.wyui.page.getByPage_callback_new = function (list) {
        app.list = list;
        app.waitPayList = [];
        for(var i=0;i<app.list.length;i++){
            if(app.list[i].auditFlag=='3'&&app.list[i].currentAuditorId==app.searchParams.userId){
                app.waitPayList.push(app.list[i])
            }
        }
        document.getElementById("scrollDiv").scrollTop = 0;
        JSBridge.call(UI, 'hideLoading')
    };
    //滚动加载回调函数
    $.wyui.page.getByPage_scroll_callback = function (list) {
        console.log(list)
        if (list.length < 15) {
            app.isMore = true;
            isLoad = false;
        } else {
            isLoad = true;
        }
        for (var i = 0; i < list.length; i++) {
            app.list.push(list[i]);
        }
        app.waitPayList = [];
        for(var i=0;i<app.list.length;i++){
            if(app.list[i].auditFlag=='3'&&app.list[i].currentAuditorId==app.searchParams.userId){
                app.waitPayList.push(app.list[i])
            }
        }
        JSBridge.call(UI, 'hideLoading')
    }
    /************************滚动加载******************************/
    var isLoad = true;
    $(window).scroll(function () {
        if ($(window).scrollTop() + $(window).height() + 20 > $(document).height()) {
            if (isLoad) {
                isLoad = false;
                if (app.selectIndex != 0) {
                    setTimeout($.wyui.page.getByPage("scroll"), 1000);
                }
            }
        }
    });
</script>
</body>
</html>